/************************************************************************

								Heroes IV
					  Copyright 2002, The 3DO Company

	------------------------------------------------------------------
  					 combat_action_message.cpp

	$Header:  $

	$NoKeywords: $

 ************************************************************************/
// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "combat_action_message.h"

#include "combat_creature.h"

t_combat_action_message::t_combat_action_message()
{
	clear();
}

t_combat_action_message::t_combat_action_message( t_combat_creature const & creature, 
														 std::string const & text, 
														 t_combat_action_message_priority priority )
	: m_creature( &creature), m_text( text ), m_priority( priority )
{
}

void t_combat_action_message::clear()
{
	m_creature = NULL;
	m_text.erase();
	m_priority = k_combat_action_message_priority_normal;
}

t_combat_creature const * t_combat_action_message::get_creature() const
{
	return m_creature;
}

std::string const & t_combat_action_message::get_text() const
{
	return m_text;
}

t_combat_action_message_priority t_combat_action_message::get_priority() const
{
	return m_priority;
}

bool t_combat_action_message::is_displayable() const
{
	return m_creature != NULL && !m_text.empty();
}

void t_combat_action_message::set_creature( t_combat_creature const & creature )
{
	m_creature = &creature;
}

void t_combat_action_message::set_text( std::string const & text )
{
	m_text = text;
}

void t_combat_action_message::set_priority( t_combat_action_message_priority priority )
{
	m_priority = priority;
}

